import React from 'react'
import {Input, message} from 'antd';
import { Button } from 'antd';
import { Select } from 'antd';
import GoodsCommTable from './GoodsCommTable'
import Axios from "axios";

const { Option } = Select;

class GoodsComm extends React.Component {
    //查询
    handleChange = e => {
        console.log(e);
        message.success('查询成功');
        Axios.post('allApi.goodsApi.searchComm',{
            limit:e.limit,
            page:e.page,
        }).then((res)=> {
            if(res.data.code===200) {
                this.success('查询成功')
            }else {
                this.error('加载出错,请联系管理员')
            }
        }).catch((err)=> {
            console.log(err);
        })
    }

    render() {
        return (
            <div>
                <div>
                    <h1>输入评论内容</h1>
                    <Input style={{ width: 180 }} placeholder="请输入评论内容" />
                    <Button type="primary" onClick={this.handleChange}>搜索</Button>
                </div>
                <GoodsCommTable></GoodsCommTable>
                <div>
                    <Select defaultValue="删除评论" style={{ width: 120 }}>
                        <Option value="删除评论">删除评论</Option>
                        <Option value="允许显示">允许显示</Option>
                        <Option value="禁止显示" >禁止显示</Option>
                    </Select>
                    <Button type="primary">确定</Button>
                </div>
            </div>
        )
    }
}

export {GoodsComm as default}